﻿@{
    ViewBag.Title = "Login";
    Layout = null;
}

<!doctype html>
<html class="no-js">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <title>登录 - 合伙人系统</title>

    <link rel="stylesheet" type="text/css" href="//lib.baomitu.com/amazeui/2.7.2/css/amazeui.min.css" />

    <link href="~/css/style_hl.css" rel="stylesheet" />
    <script type="text/javascript" src="//lib.baomitu.com/jquery/2.2.4/jquery.min.js"></script>
    <!--[if (gte IE 9)|!(IE)]><!-->
    <script type="text/javascript" src="//lib.baomitu.com/amazeui/2.7.2/js/amazeui.min.js"></script>

    <!--<![endif]-->
    <!-- <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> -->
    <!-- 微信自定义接口 -->
    <!-- <script>
        wx.config();
        wx.ready(function(){
                        wx.hideMenuItems({
                           menuList: ["menuItem:share:timeline"]
                        });
            wx.onMenuShareAppMessage({
                title: document.title,
                desc: "",
                link: window.location.href ,
                imgUrl: ""
            });
            wx.onMenuShareTimeline({
                title: document.title,
                desc: "",
                link: window.location.href,
                imgUrl: ""
            });
        });
    </script> -->
    <!-- 微信自定义接口 -->

</head>

<body>

    <div class="am-modal am-modal-alert" tabindex="-1" id="fq_alert">
        <div class="am-modal-dialog">
            <div class="am-modal-hd" id="fq_alert_title"></div>
            <div class="am-modal-bd" id="fq_alert_info">
            </div>
            <div class="am-modal-footer">
                <span class="am-modal-btn">确定</span>
            </div>
        </div>
    </div>

    <div class="am-modal am-modal-confirm" tabindex="-1" id="fq_confirm">
        <div class="am-modal-dialog">
            <div class="am-modal-hd" id="fq_confirm_title"></div>
            <div class="am-modal-bd" id="fq_confirm_info"></div>
            <div class="am-modal-footer">
                <span class="am-modal-btn" data-am-modal-confirm>确定</span>
            </div>
        </div>
    </div>

    <link href="~/css/order_login.css" rel="stylesheet" />
    <link rel="stylesheet" href="//at.alicdn.com/t/font_5h08k489bresif6r.css">

    <div class="fq-order-login am-text-center am-text-default am-vertical-align">
        <div class="am-inline-block am-vertical-align-middle">
            <img class="fq-login-partner fq-text-white" src="/images/partner.png" />

            <form class="am-margin-top-xl">
                <div class="am-input-group am-center am-text-center">
                    <i class="iconfont icon-yonghu am-margin-right-sm"></i>
                    <input class="fq-login-user am-text-default" type="text" placeholder="请输入你的用户名" id="username">
                </div>

                <div class="am-input-group am-center am-text-center am-margin-top">
                    <i class="iconfont icon-suo am-margin-right-sm"></i>
                    <input class="fq-login-password am-text-default" type="password" placeholder="请输入你的密码" id="password">
                </div>
            </form>
            <button class="fq-login-button am-block am-margin-top-xl am-padding-vertical-xs am-padding-horizontal am-round am-text-center am-center" id="submit">立即登录</button>
            <a href="/agent/apply.html" class="am-inline-block am-text-sm am-margin-top" style="color:white;text-decoration:underline;">我要申请</a>
        </div>
    </div>
    <script type="text/javascript" src="//cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.js"></script>
    <script src="~/js/common_raw.js"></script>
    <script>
        function fq_alert(info) {
            $('#fq_alert_info').text(info);
            $('#fq_alert').modal();
        }

        $(function () {
            $('#submit').click(function () {
                var username = $.trim($('#username').val());
                var password = $.trim($('#password').val());
                if (username.length == 0) {
                    fq_alert('请输入用户名');
                    return;
                }
                if (password.length == 0) {
                    fq_alert('请输入密码');
                    return;
                }
                $.post('/postlogin.html', { "username": username, "password": password }, function (res) {
                    if (res.State == true) {
                      
                        setCookie("Authorization", res.Datas, 2 * 60 * 3600);
                        window.location.href = '/agent.html';
                    } else {
                        $('#fq_alert_info').text(res.Message);
                        $('#fq_alert').modal();
                    }
                });
            });
        });
    </script>

